home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_200 / 203_01 / yam6.c < prev    next >
Text File  |  1980-01-01  |  4KB  |  104 lines

  1. #include <stdio.h>
  2. #define PATHLEN 65    
  3. #define FLAG int
  4. #define CMDLEN 132
  5.  
  6. #ifndef IOTYPE                /* may be char* or unsigned for memory mapped i/o */
  7. #define IOTYPE int
  8. #endif
  9.  
  10. /* global configuration buffers */
  11. char rxnono[15];    /* characters will be stripped if received and Ignrx true */
  12.  
  13. char defdisk;                /* default disk */
  14. FILE *fin,*fout;
  15. int cfast;
  16. char checksum;                /* delcared here for speed */
  17. unsigned oldcrc;            /* accumulates CRC checksum */
  18. int wcj, firstch, errors;
  19. FLAG firstsec;                 /* first sector, C instead of NAK for crc */
  20.  
  21. FLAG Quiet;
  22. char Ttycol, Lpcol;            /* column for tab expansion */
  23. int tabstop;                /* current tab expansion */
  24. FLAG Rfile;                    /* receiving into a file */
  25. FLAG Tfile;                    /* transmitting from a file */
  26. FLAG Crcflg;                 /* 1 if using crc, 0 otherwise */
  27. FLAG Batch;                    /* Batch (multi-file) xfer */
  28. FLAG Creamfile;                /* true means o.k. to delete old file on rx */
  29. int blklen;                    /* length of blocks for s and r, usually 128 */
  30. unsigned totsecs;            /* accumulator of number of sectors sent/received */
  31. unsigned toterrs;            /* total number of errors in xfer(s) */
  32. FLAG Txgo;                     /* file sending start/stop (XON/XOFF) */
  33. FLAG Dumping;                /* not Squelched ^R */
  34. FLAG Pflag;                    /* printing the rx stuff */
  35. #ifdef MYSYSTEM
  36. FLAG Cis02;                    /* Special functions for CIS02 access to Compuserve */
  37. #endif
  38. FLAG Ctlview;                /* Term function shows control chars as ^char */
  39. FLAG View;                    /* View data being transmitted/received if file xfer */
  40. FLAG Echo;                    /* Echo modem data back to itself only in chat */
  41. FLAG Hdx;                    /* Half Duplex connection -no echo from far end */
  42. FLAG Chat;                     /* treat kbd \r as crlf when chatting */
  43. FLAG Gototerm;                /* go to term after file xfer */
  44. FLAG Exoneof;                /* exit from term() when finished with file */
  45.  
  46. /* Following flags affect data as it is written to file, not captured */
  47. FLAG Zeof;            /* Terminate data capture & close file on ^Z */
  48. FLAG Squelch;        /* Turn capture on after ^R, off before ^T */
  49. char GOchar;        /* normally \n; resumes sending in EOL _ CRWAIT mode */
  50. char *Txmoname;        /* asciz string corresponding to Txeoln mode */
  51. FLAG Txeoln;        /* what to do at the end of a line */
  52. char xon;            /* character for xon */
  53. char xoff;            /* character for xoff */
  54.  
  55. /* For controls based on time since last RX char mostly */
  56. unsigned Timeout;        /* measure of how long since last rxchar */
  57. unsigned Tpause;        /* when ++Timeout==Tpause, do something ... */
  58. FLAG Xoffflg;            /* !=0 if we sent XOFF to stop the bubble machine */
  59. FLAG Waitecho;             /* Wait for echo to stop when sending file */
  60.  
  61. /* If Waitbunch, Wait for Throttle loops each waitnum txchars */
  62. FLAG Waitbunch;
  63. unsigned Waitnum;        /* do Waitecho each time chars_sent == Waitnum */
  64. unsigned Throttle;
  65. FLAG Txwait;             /* used with throttle */
  66. unsigned Txtimeout;        /* counted down to 0, then Txwait becomes false */
  67.  
  68. unsigned T1pause;        /* for setting 0.1 second timeout for readline */
  69. int Lastrx;                /* last char received, for detecting CAN CAN */
  70.  
  71. /*
  72.  * start, end, input, output, printer-output pointers and marker
  73.  * used with data capture
  74.  */
  75. char *bufst, *bufend, *bufcq, *bufcdq, *buffcdq, *bufpcdq, *bufmark;
  76. unsigned Nfree;                /* Number of characters free in capture buf */
  77. unsigned Bufsize;
  78. FLAG Wrapped;                /* Buffer insertion pointer has wrapped around */
  79. IOTYPE Dport;                /* data port address */
  80. unsigned commport;            /* comm port number, related to actual port # */
  81. char Mstatus;                 /* contents of modem error register if modem error */
  82. unsigned Baudrate;            /* current baudrate */
  83. FLAG Originate;                /* Originate mode requested */
  84. FLAG Ignrx;                    /* if true, rxnono bits will be thrown awaw */
  85. char cmdbuf[CMDLEN+2], *cp;    /* for commands entered directly (not argv) */
  86. char Rname[PATHLEN], Tname[PATHLEN];         /* saved file names */
  87.  
  88. #define NUMVALS 257             /* 256 data values plus SPEOF*/
  89. #define KSIZE  1024            /* block length with k option */
  90.  
  91. /* Some declarations for USQ feature */
  92. union
  93. {
  94.             FILE *ufbuf;
  95.             char ubuf[KSIZE];
  96.             /* Decoding tree for usq feature */
  97.             struct
  98.             {
  99.                 int children[2];            /* left, right */
  100.             } dnode[NUMVALS - 1];
  101. } Utility;
  102.  
  103. char Phone[80];                /* phone number read in from file */
  104.